#include <ros/ros.h>
#include <serial_pack/compareAtt.h>

void compareCallback(const serial_pack::compareAtt ::ConstPtr& msg)
{
    ROS_INFO_STREAM("RPY From mlx calculate:" << std::endl);
    ROS_INFO_STREAM("Pit:" << msg->pit1<< "      ");
    ROS_INFO_STREAM("Rol:" << msg->rol1<< "     ");
    ROS_INFO_STREAM("Yaw:" <<msg->yaw1 << "    " << std::endl);

    ROS_INFO_STREAM("RPY From imu calculate:" << std::endl);
    ROS_INFO_STREAM("Pit:" << msg->pit2<< "      ");
    ROS_INFO_STREAM("Rol:" << msg->rol2 << "     ");
    ROS_INFO_STREAM("Yaw:" << msg->yaw2<< "    " << std::endl);
}

int main(int argc, char **argv)
{
    ros::init(argc, argv, "stm32_subscriber");
    ros::NodeHandle nh;
    ros::Subscriber compare_sub = nh.subscribe("compare_att", 10, compareCallback);
    ros::spin();
    return 0;
}